//
//  myTableViewController2.m
//  JianShu
//
//  Created by 苗钧豪 on 16/8/1.
//  Copyright © 2016年 苗钧豪. All rights reserved.
//

#import "myTableViewController2.h"
#import "oneTableViewCell.h"
#import "twoTableViewCell.h"

@interface myTableViewController2 ()
@property(nonatomic,strong)NSArray *arr1;
@property(nonatomic,strong)NSArray *arr2;
@end

@implementation myTableViewController2

- (void)viewDidLoad {
    [super viewDidLoad];
    _arr1 = [NSArray arrayWithObjects:@"公开文章",@"私密文章",@"收藏的文章",@"喜欢的文章",@"我的专题",@"我的文集", nil];
    _arr2 = [NSArray arrayWithObjects:@"黑夜模式",@"浏览历史",@"通用设置",@"分享APP",@"意见反馈",@"给简书评分", nil];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    self.tableView.sectionHeaderHeight = 20;
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 20;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section == 0) {
        return 1;
    }else if (section == 1) {
        return _arr1.count;
    }else {
        return _arr2.count;
    }
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        oneTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"222" forIndexPath:indexPath];
        return cell;
    }
    else if (indexPath.section == 1) {
    
    twoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"333" forIndexPath:indexPath];
        cell.myLabel.text = _arr1[indexPath.row];
        cell.numberlabel.text = @"0";
    return cell;
    } else {
        twoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"333" forIndexPath:indexPath];
        cell.myLabel.text = _arr2[indexPath.row];
        cell.numberlabel.text = @"";
        return cell;
    }
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
